import { marked } from "marked";
import { useMemo, useState } from "react";

const Analysis = () => {
  const [value, setValue] = useState("");
  const output = useMemo(() => {
    return marked(value);
  }, [value]);
  function handleChange(event: any) {
    setValue(event.target.value);
  }

  return (
    <div>
      <textarea value={value} onChange={handleChange} />
      <hr />
      <div dangerouslySetInnerHTML={{ __html: output }}></div>
    </div>
  );
};

export default Analysis;
